package com.jrx.anytxn.transaction.mapper.ext;

import com.jrx.anytxn.transaction.entity.TlLoanClassifyChange;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 五级分类变动扩展
 */
public interface ExtTlLoanClassifyChangeMapper {

    /**
     * 根据业务日期查询
     * @param businessDate
     * @return
     */
    List<TlLoanClassifyChange> selectByBusinessDate(@Param("businessDate") String businessDate);


    /**
     * 批量插入五级分类变动表
     * @param tlLoanClassifyChangeList
     */
    void batchInsert(List<TlLoanClassifyChange> tlLoanClassifyChangeList);

    /**
     * 获取客户该笔订单上一次变动记录
     * @param tenantId
     * @param customerId
     * @param loanId
     * @return
     */
    TlLoanClassifyChange selectPreMessage(@Param("tenantId") String tenantId,
                                          @Param("customerId") String customerId,
                                          @Param("loanId") String loanId,
                                          @Param("businessDate") String businessDate);

    /**
     * 获取订单最近的一次记录
     *
     * @param tenantId
     * @param customerId
     * @param loanId
     * @return TlLoanClassifyChange
     */
    TlLoanClassifyChange selectLastByLoanId(@Param("tenantId") String tenantId,
                                          @Param("customerId") String customerId,
                                          @Param("loanId") String loanId);
}
